package com.tencent;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallback implements FallbackFactory<UserService> {

    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User findById(Long id) {
                return new User(-1L, "熔断了", "fallbackFactory工厂熔断了");
            }
        };
    }
}
